<?php 
if (! defined('BASEPATH')) {
	exit('Access Denied');
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $row['title'];?>_文章编辑</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/static/css/admin/base.css">
<link rel="stylesheet" href="<?php echo base_url();?>/static/js/editor/themes/default/default.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/static/css/admin/window.css" />
<script charset="utf-8" src="<?php echo base_url();?>/static/js/editor/kindeditor-min.js"></script>
<script charset="utf-8" src="<?php echo base_url();?>/static/js/editor/lang/zh_CN.js"></script>
<script src="<?php echo base_url();?>/static/js/jquery.js" language="javascript"></script>

<script src="<?php echo base_url();?>/static/js/validate/validator.js" language="javascript"></script>
<script src="<?php echo base_url();?>/static/js/DatePicker/WdatePicker.js" language="javascript"></script>
<script type="text/javascript" src="<?php echo base_url();?>/static/js/admin/tipswindown.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//提交
$("#btnSave").click(function(){
    if($("#newform").Valid() == false || !$("#newform").Valid()) return false;
});

});
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="content"]', {
		allowFileManager : true
	});

//颜色
	var colorpicker;
	K('#colorpicker').bind('click', function(e) {
		e.stopPropagation();
		if (colorpicker) {
			colorpicker.remove();
			colorpicker = null;
			return;
		}
		var colorpickerPos = K('#colorpicker').pos();
		colorpicker = K.colorpicker({
			x : colorpickerPos.x,
			y : colorpickerPos.y + K('#colorpicker').height(),
			z : 19811214,
			selectedColor : 'default',
			noColor : '无颜色',
			click : function(color) {
				K('#color').val(color);
				colorpicker.remove();
				colorpicker = null;
			}
		});
	});
	K(document).click(function() {
		if (colorpicker) {
			colorpicker.remove();
			colorpicker = null;
		}
	});

	
});
//打开关键词
function open_tags_list(){
	tipsWindown('关键词列表',"iframe:<?php echo site_url("admin/archive/index/archive_add");?>?action=open_tags_list",800,450,"true","","true","");	
}
</script>
</head>
<body leftmargin="8" topmargin="8">
<div class="nav_des">
<span class="des">文章管理>></span>
	<a href="<?php echo site_url("admin/archive/index/archive_list");?>">文章管理</a>
	<a href="<?php echo site_url("admin/archive/index/archive_add");?>" class="nav_des_hover">文章添加</a>
	<a href="<?php echo site_url("admin/archive/index/archive_add");?>?action=tags">文章关键词</a>
</div>

<!--  内容列表   -->
<?php echo form_open_multipart('admin/archive/index/archive_edit');?>
<!--
<form name="form2" method="post" name="" action="<?php echo site_url("admin/archive/index/archive_add");?>" id="newform">
-->
<input type="hidden" value="doedit" name="action">
<input type="hidden" name="picname" value="<?php echo $row['litpic'] ;?>">
<input type="hidden" value="<?php echo $row['id'];?>" name="id">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
	<td height="24" colspan="" >&nbsp;文章添加&nbsp;</td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">
	<td >文章标题:<input type="text" name="title" class="form_input"  required="true" errmsg="请输入60个字符之内" tip="请输入60个字符之内" style="width:300px" value="<?php echo $row['title'] ;?>"> </td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">

	<td>标题颜色:<input type="text" id="color" name="color"  value="<?php echo $row['color'] ;?>"/> <input type="button" id="colorpicker" value="打开取色器" /></td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">
	<td >关键词:<input type="text" name="keyword" class="form_input"   value="<?php echo $row['keywords'] ;?>" style="width:300px" id="keyword">&nbsp;&nbsp;&nbsp;<input type="button" id="tagsid" value="打开关键词" onclick="open_tags_list()" />请用半角逗号隔开 例如 js,jquery</td>
</tr>

<tr align="" bgcolor="#FAFAF1" height="22">
	<td >点击量:<input type="text" name="click" class="form_input"   value="<?php echo $row['click'] ;?>">&nbsp;&nbsp;&nbsp;请输入数字</td>
</tr>

<tr align="" bgcolor="#FAFAF1" height="22">
	<td >文章状态:开启:<input type="radio" name="status" value="1" <?php if($row['status'] == 1){echo "checked";}?>>关闭:<input type="radio" name="status" value="0"  <?php if($row['status'] == 0){echo "checked";}?>></td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">
	<td >发布时间:<input type="text" name="publish_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate"  style="width:300px" value="<?php echo $row['publish_time'] ;?>">&nbsp;&nbsp;&nbsp;请选择发布时间</td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">

	<td>文章栏目:<select id="typeid" style="width:300px" name="typeid">
	<?php 
		if($column){
			foreach($column as $column_key=>$column_val){
			
	?>
	<option value="<?php echo $column_val['tree_id'];?>" <?php if($column_val['tree_id'] == $row['typeid']){echo "selected";}?>><?php echo htmlspecialchars_decode($column_val['tree_name']);?></option>
	<?php 
		}
	}
	?>
	</select></td>
</tr>
<tr align="" bgcolor="#FAFAF1" height="22">

	<td>文章缩略图:<input type="file" name="litpic" value="" id="litpic">
	备注：请上传缩略图
	<img src="<?php echo base_url() ;?>/uploadfiles/archives/<?php echo $row['litpic'] ;?>">
	</td>
</tr>

<tr align="" bgcolor="#FAFAF1" height="22">

	<td>文章内容:<textarea name="content" style="width:900px;height:400px;visibility:hidden;" ><?php echo  $row['body'];?></textarea></td>
</tr>

<tr bgcolor="#FAFAF1">
<td height="28" colspan="">
	&nbsp;

	<input type="submit" value="提&nbsp;&nbsp;交" class="coolbg" id='btnSave'>
</td>
</tr>

</table>

</form>

</body>
</html>